<include file="../Public/_header.html" />
<div class="so_main">
		  
  <div class="page_tit">代金券分类</div>
  <div class="Toolbar_inbox">
		<a href="javascript:void(0);" class="btn_a" onclick="add();"><span>生成分类</span></a>
  </div>
  
  <div class="list">
  <table id="goods_list" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th style="width:30px;">
        <input type="checkbox" id="checkbox_handle" onclick="table_checkAll(this)" value="0">
        <label for="checkbox"></label>
    </th>
    <th class="line_l" style="text-align:center">有效|删除</th>
    <th class="line_l" style="text-align:center">ID</th>
    <th class="line_l" style="text-align:center">别名</th>
    <th class="line_l" style="text-align:center">规则</th>
    <th class="line_l" style="text-align:center">说明</th>
    <th class="line_l" style="text-align:center">创建时间</th>
    <th class="line_l" style="text-align:center">操作</th>
  </tr>
  <volist id="vo" name="datapage['data']">
      <tr overstyle='on' id="pay_{$vo.id}">
        <td><input type="checkbox" name="checkbox" id="checkbox2" onclick="table_checkon(this)" value="{$vo.id}"></td>
        <td style="text-align:center;padding: 6px 0 6px 0px;color:red">
        	{$vo.enable}&nbsp;|&nbsp;{$vo.is_delete}</td>
        <td>{$vo.id}</td>
       
 		<td style="text-align:center">{$vo['sort_code']}</td>
 		<td style="text-align:center">{$vo['rule']}</td>		
		<td style="text-align:center">{$vo.desc}</td>
		<td style="text-align:center">{:paramMillisecond2Date($vo['ctime'],'Y-m-d H:i', '未设置' )}</td>

        <td style="text-align:center">
            <a href="javascript:void(0);" title="查看详细的支付结果！">详情</a>
        </td>
      </tr>
  </volist>
  </table>

  </div>
  <div class="Toolbar_inbox">
    <div class="page_box">{$datapage['html']}</div>
  </div>
 
</div>

 <div class="clear"></div>

<script>
    //鼠标移动表格效果
    $(document).ready(function(){
    	table_init();
    });
    
  	//添加分类
    function add() {
        ui.box.load("{:U('/Cashcoupon/addRule')}", {title:'添加分类'});
    }
    
    //编辑分类
    /**
    function edit(id) {
        ui.box.load("{:U('/Cashcoupon/editRule',array('id'=>''))}"+id, {title:'编辑分类'});
    }
    **/
    
    //删除分类
    function del(aid) {
        aid = aid ? aid : table_getChecked();
        aid = aid.toString();
        if(aid == '') return false;
		if(!confirm('确定删除么？')){
				return;
		}
        //提交删除
        $.post("{:U('/Shelf/doPutoff')}", {ids:aid}, function(res){
	        if(res == '1') {
		        aid = aid.split(',');
		        $.each(aid, function(i,n){
		            $('#partner_'+n).remove();
		        });
	            ui.success('删除成功');
	        }else {
	        	ui.success('删除失败');
	        }
        });
        
        
    }
</script>

<include file="../Public/_footer.html" />